Technical Field
The present disclosure relates to computer communications technologies, and particularly to a method and apparatus for data transmission.
Related Art
A traditional acentric distributed storage system commonly uses a consistent hashing algorithm for allocating storage space and searching for data.
A range of output generated by performing a consistent hashing algorithm on data keys may map to a fixed ring space (that is, the maximum output hash value may be close to the minimum output hash value). For data nodes, each node may be randomly assigned to a certain value, and a node's location in the ring space may be labeled so as to assign a range of hash values that each node is responsible for in storing data. Generally, each node is responsible for storage for hash values between the node value and some region in numbering areas between the node values. In storage space allocation and data query, consistent hashing may be directly performed on data keys to generate hash values, and nodes for storing data be allocated or located in a query based on the hash values corresponding to the data keys.
Such a method may achieve route storage, fast query and space allocation based on data keys that correspond to the data being stored and queried. However, as allocation of storage spaces is directly relevant to the data keys, the consistent hashing algorithm must depend on the data keys to randomly select storage nodes, which may result in unbalanced distribution of loads and storage of the data in the nodes.